import 'package:flutter/material.dart';
import '../base/view.dart';

class RegisterPage extends StatefulWidget {
  const RegisterPage({Key? key}) : super(key: key);

  @override
  _RegisterPageState createState() => _RegisterPageState();
}

var _sex = true;

class _RegisterPageState extends State<RegisterPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: getAppbar('注册'),
      body: Padding(
        padding: EdgeInsets.all(10),
        child: SingleChildScrollView(
          child:  Form(
              child: Column(
                children: [
                  TextField(
                    decoration: InputDecoration(labelText: '登陆账号'),
                  ),
                  TextField(
                    textInputAction: TextInputAction.send,
                    decoration: InputDecoration(
                        labelText: '手机号码',
                        suffix: ElevatedButton(
                          onPressed: () {},
                          child: Text('获取验证码'),
                        )),
                  ),
                  TextField(
                    decoration: InputDecoration(labelText: '验证码'),
                  ),
                  TextField(
                    decoration: InputDecoration(labelText: '登陆密码'),
                  ),
                  TextField(
                    decoration: InputDecoration(
                        labelText: '中文姓名',
                        suffix: Row(
                          mainAxisAlignment: MainAxisAlignment.end,
                          mainAxisSize: MainAxisSize.min,
                          children: [
                            Switch(
                              value: _sex,
                              onChanged: (v) {
                                setState(() {
                                  _sex = v;
                                });
                              },
                            ),
                            Text(_sex ? '男':'女'),
                          ],
                        )
                    ),
                  ),
                  SizedBox(height: 20,),
                  Container(
                    child: ElevatedButton(onPressed: () {}, child: Text('注册')),
                    width: double.infinity,
                  )
                ],
              )),
        )

      ),
    );
  }
}
